package com.Trainer;

import com.Trainer.TrainerInterface.TrainerBottomLeftPanel;
import com.Trainer.TrainerInterface.TrainerUpPanel;
import com.data.TrainerData;
import com.data.UpData;

public class API {

    public static void getNext(String patten,UpData upData, TrainerData trainerData, TrainerBottomLeftPanel trainerBottomLeftPanel, TrainerUpPanel trainerUpPanel){
        //更新upData
        upData.setSum(upData.getSum()+1);
        //更新TrainerData
        trainerData.setTrainerData(patten);
        //更新trainerUpPanel
        trainerUpPanel.getTotal().setText(""+upData.getSum());
        //更新trainerBottomLeftPanel
        trainerBottomLeftPanel.getAnsText().setText("");
        trainerBottomLeftPanel.getOperand1().setText(""+trainerData.getOp1());
        trainerBottomLeftPanel.getOperand2().setText(""+trainerData.getOp2());
        trainerBottomLeftPanel.getOperator1().setText(""+trainerData.getOpLabel());
        trainerBottomLeftPanel.getAnsJudge().setText("?");
        //test
        System.out.println(trainerData.getOp1()+"  "+trainerData.getOp2());
    }

}
